import com.speljohan.rsbot.script.Constants;
import com.speljohan.rsbot.script.Random;
import com.speljohan.rsbot.script.wrappers.RSInterface;

public class TeleotherCloser extends Random {
	@Override
	public boolean activateCondition() {
		final RSInterface iface = RSInterface.getInterface(326);
		return iface.isValid()
				&& iface.getChild(2).getText().contains("wants to teleport");
	}

	@Override
	public String getAuthor() {
		return "ToshiXZ";
	}

	@Override
	public String getName() {
		return "Teleblock Closer";
	}

	@Override
	public double getVersion() {
		return 1.0;
	}

	@Override
	public int loop() {
		atInterface(RSInterface.getInterface(326).getChild(8));
		wait(random(500, 750));
		openTab(Constants.TAB_OPTIONS);
		wait(random(500, 750));
		log.info("Disabling accept aid");
		clickMouse(random(569, 603), random(415, 440), false);
		return -1;
	}
}
